<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ include file="/views/commons/taglibs.jsp" %>
<!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>众秀众筹</title>
	<meta name="Keywords" content="众筹，众筹网，众筹导航，众筹门户，股权众筹，众筹平台，众筹圈子人，众筹项目，众筹三方
影视众筹，店铺众筹，餐饮众筹，众筹报告，创业众筹，投后管理，项目融资，项目众筹，权力的游戏，冰与火之歌" />
	<meta name="Description" content="汇集各行业高手分析众筹项目，行业问答，众筹资讯。" />
	<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible" />
	<meta name="renderer" content="webkit"/>
	<link rel="stylesheet" href="<%=path%>/css/bootstrap/3.3.5/css/bootstrap.min.css" />
	<link rel="stylesheet" href="<%=path%>/css/cropper.min.css" />
	<link rel="stylesheet" href="<%=path%>/css/cz.css" />

	<script src="<%=path%>/js/jquery-1.11.0.min.js"></script>
	<script src="<%=path%>/js/plugins/datapicker/bootstrap-datepicker.js"></script>
	<script src="<%=path%>/js/plugins/layer/layer.js"></script>
	<script src="<%=path%>/css/bootstrap/3.3.5/js/bootstrap.min.js"></script>

	<script type="text/javascript" src="<%=path%>/js/slider.js"></script>
	<script type="text/javascript" src="<%=path%>/js/cropper.min.js"></script>
	<script type="text/javascript" src="<%=path%>/js/common.js"></script>
</head>
<body class="gray-bg">
<jsp:include page="/views/commons/header.jsp"></jsp:include>
<div class="container page-single">
	<div class="col-md-12">
		<div class="panel panel-default">
			<div class="panel-heading">
				<h3 class="panel-title">问题编辑</h3>
			</div>
			<div class="panel-body pd_box">
				<form class="form-horizontal" style="padding:40px 80px;" id="question_form" action="javascript:updateQuestion()">
					<input type="hidden" name="questionId" value="${question.questionId}">
					<input type="hidden" name="answerUser" value="${question.answerUser}">	
					<div class="form-group">
						<h4 class="f16">问题描述</h4>
						<p class="f12 c_999">1、如果你是投资者提问，请注明咨询的项目名，平台名，咨询的问题。</p>
						<p class="f12 c_999">2、如果是创业者，直接写问题即可。</p>
						<p class="f12 c_999">3、最多200字</p>
						<span class="f12 c_f60">提交项目拆解申请需要发放3元红包</span>
					</div>
					<div class="form-group">
						<label for="answer_user_name">提问人：</label>
						<input type="text" placeholder="提问人" readonly="readonly" 
						class="form-control" name="publishUserName" value="${question.publishUserName}">
					</div>
					<div class="form-group">
						<label for="answer_user_name">回答人：</label>
						<input type="text" placeholder="回答人" readonly="readonly" id="answer_user_name" 
						class="form-control" name="answerUserName" value="${question.answerUserName}">
					</div>
					
					<div class="form-group">
						<label >问题：</label>
						<textarea  class="form-control" name="questionDetail" readonly="readonly" rows="3"  cols="93">${question.questionDetail}</textarea>
					</div>
					
					<div class="form-group">
						<label >回答<em>*</em></label>
						<textarea  class="form-control" name="answerDetail"  rows="3"  cols="93">${question.answerDetail}</textarea>
					</div>
					
					<div class="form-group text-center">
						<label>提交后两天内制定回答人未回答，提问缴纳的费用返还给提问人</label>
						<div class="pt10 mb10">
							<button class="btn btn-primary btn-lg" type="submit">提交</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>

<jsp:include page="/views/commons/footer.jsp"></jsp:include>
<script type="text/javascript">
	function updateQuestion(){
		$("#question_confirm_btn").addClass("disabled").attr("disabled","disabled").val("提交中");
		$.ajax({
			url : path + "/check/question/answer",
			type : "post",
			dataType : "json",
			data : $("#question_form").serialize(),
			success : function(data)
			{
				if(data.result){
					layer.msg("发布成功",{icon: 1});;
					window.location.href=path + "/views/question/question_list.jsp";
				}else{
					layer.msg(data.message,{icon: 2});;
					$("#question_confirm_btn").removeClass("disabled").removeAttr("disabled").val("提交");
				}
			},error:function(){
				layer.msg("服务器网络繁忙",{icon: 2});
				$("#question_confirm_btn").removeClass("disabled").removeAttr("disabled").val("提交");
			}
		});
	}
</script>
</body>
</html>